<?php
class Nhatuyendung extends AppModel {
	var $name = 'Nhatuyendung';
    var $actsAs = array('Uploader.FileValidation');
	var $validate = array(
	   "tenntd"=>array(
                    "rule1" =>array(
                        "rule" => "notEmpty",
                        "message" => "Nh?p v�o t�i kho?n",
                        ),
                    "rule2" => array(
                        "rule" => "/^[a-z0-9_.]{3,}$/i",
                        "message" => "T�i kho?n ph?i l� k� t? ho?c s?, t? 3 k� t? tr? l�n.",
                        ),
                    "rule3" =>array(
                        'rule' => 'isUnique',
                        'message' => 'T�i kho?n n�y d� t?n t?i trong h? th?ng.'
                        ),
               
             ));
/*		"quymo" => array
                    (
                        "rule" => "notEmpty",

                        "message" => "Ch?n lo?i doanh nghi?p",
                     ),
        "passntd"=>array(
                        "rule" => "notEmpty",
                        "message" => "Nh?p v�o m?t kh?u",
                        "on" => "create"
                            ),
        "re_pass"=>array(
                         "rule1"=>array(
                                 "rule" => "notEmpty",
                                 "message" => "Nh?p v�o x�c nh?n m?t kh?u",
                                 "on" => "create"  
                          ),
                        "match" => array( 
                                "rule" => "ComparePass", 
                                "message" => "X�c nh?n m?t kh?u v� m?t kh?u kh�ng kh?p",
                                         ),
                         ),
      /*  "emailntd"=>array(
                        "rule1" =>array(
                                    "rule" => "email",
                                    "message" => "Email kh�ng h?p l�.",
                                       ),
                         "rule2" => array(
                                     'rule' => 'isUnique',
                                     'message' => 'Email n�y d� t?n t?i trong h? th?ng.',
                                       ),
                              ),
        "dienthoai"=>array(
                        "rule1" =>array(
                                     "rule" => "notEmpty",
                                      "message" => "Nh?p v�o s? di?n tho?i",
                                                                    ),
                        "rule2" => array(
                                       "rule" => "/^[0-9]{10,}$/i",
                                       "message" => "�i?n tho?i ph?i l� s? v� c� t? 10 s? tr? l�n. Vui l�ng nh?p l?i",
                                       ),
                             ),
        
        "yahoontd"=>array(
                         "rule1" => array(
                                     'rule' => 'isUnique',
                                     'message' => 'Nick chat d� t?n t?i.'
                                       ),
                              )
						);
*/                        
function ComparePass(){
        if($this->data['Nhatuyendung']['passntd']!=$this->data['Nhatuyendung']['re_pass']){
            return FALSE;
        }
        else{
            return TRUE;
        }
    }
    }